package main

import (
	"fmt"
	"gostudy/util"
)

func main() {
	fmt.Println("Hello, World!")
	//函数调用测试
	fmt.Println(util.CountNumber(1, 2))
	a := 5
	fmt.Println(util.CountNumber(a, 2))
	testPointer(&a)
	fmt.Println(a)

	testPointer1(&a)
	fmt.Println(a)
}

/*
改变指针指向的地址
*/
func testPointer(p *int) {
	*p = 2
}

/*
不能改变指针本身
*/
func testPointer1(p *int) {
	p = nil
}

/*
交换变量值
*/
func swapValue1(a, b *int) {
	*a, *b = *b, *a
}
func swapValue(a, b int) (int, int) {
	return b, a
}
